const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const app = new Koa();

const useRoutes = require('../router');
const errorHandle = require('./error-handle')


app.useRoutes = useRoutes;

app.use(bodyParser());
app.useRoutes(app);

app.on('error',errorHandle)
module.exports = app